import logging

# 设置日志
logger = logging.getLogger(__name__)


def review_story(story, rules):
    issues = []
    for rule in rules:
        if not rule.check(story):
            issues.append(rule.message)

    if issues:
        logger.error(f"Review found issues: {issues}")
        return False
    else:
        logger.info("Story approved.")
        return True


# 示例规则类
class Rule:
    def __init__(self, message, check_func):
        self.message = message
        self.check = check_func


# 调用函数
if __name__ == "__main__":
    story = "这是一个示例故事"
    rules = [Rule("故事必须包含'起义'", lambda x: "起义" in x)]
    review_story(story, rules)
